package com.Ajava1801D.线程;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/10/6  15:19
 * 描述: 关于线程的测试
 */
public class TestUUThread {

    public static Integer yyy=0;

    public static void main(String[] args) throws InterruptedException, ExecutionException {

       /* List<Integer> list=new ArrayList<>();

        TestRunable2 testRunable21=new TestRunable2(list);
        TestRunable2 testRunable22=new TestRunable2(list);



        Thread thread1 = new Thread(testRunable21);

        Thread thread2 = new Thread(testRunable22);

        thread1.start();
        thread2.start();

        thread1.join();
        thread2.join();

        System.out.println("=============="+list.size());*/


        FutureTask<String> futureTask=new FutureTask<String>(new TestCallable2());
        Thread thread3 = new Thread(futureTask);
        thread3.start();


        String s = futureTask.get();

        System.out.println(s);

    }

}
